Deprecate and hardcode default toolbar style setting
authorWilliam Jon McCann <william.jon.mccann@gmail.com>
Mon, 8 Jul 2013 17:28:48 +0000 (13:28 -0400)
committerWilliam Jon McCann <william.jon.mccann@gmail.com>
Mon, 8 Jul 2013 19:02:28 +0000 (15:02 -0400)
Toolbar style can still be changed on a per-widget basis as
needed by the application developer.

gdk/wayland/gdkscreen-wayland.c
gdk/win32/gdkproperty-win32.c
gdk/x11/gdksettings.c
gtk/gtksettings.c
gtk/gtktoolbar.c
gtk/gtktoolpalette.c

index 6768fabea11e0e15a37cc2c94fa3f8071bba6178..4ef5ee2d51adadd8a9107e26b846d91c468d1fc8 100644 (file)
@@ -499,7 +499,6 @@ static TranslationEntry translations[] = {
   { "org.gnome.desktop.interface", "font-name", "gtk-font-name", G_TYPE_STRING, { .s = "Cantarell 11" } },
   { "org.gnome.desktop.interface", "gtk-im-module", "gtk-im-module", G_TYPE_STRING, { .s = "simple" } },
   { "org.gnome.desktop.interface", "enable-animations", "gtk-enable-animations", G_TYPE_BOOLEAN, { .b = TRUE } },
-  { "org.gnome.desktop.interface", "toolbar-style", "gtk-toolbar-style", G_TYPE_STRING, { .s = "both-horiz"} },
   { "org.gnome.desktop.interface", "toolbar-icons-size", "gtk-toolbar-icon-size", G_TYPE_STRING, { .s = "large"} },
   { "org.gnome.settings-daemon.peripherals.mouse", "double-click", "gtk-double-click-time", G_TYPE_INT, { .i = 250 } },
   { "org.gnome.settings-daemon.peripherals.mouse", "drag-threshold", "gtk-dnd-drag-threshold", G_TYPE_INT, {.i = 8 } },
index 11268ab91027b7d2e466b332e7e1b4e2f75a9401..cb2a08da4a05950ac0b572679ac36a04e06a2c5b 100644 (file)
@@ -308,7 +308,6 @@ _gdk_win32_window_delete_property (GdkWindow *window,
   "Gtk/ColorPalette\0"        "gtk-color-palette\0"
   "Gtk/FontName\0"            "gtk-font-name\0"
   "Gtk/KeyThemeName\0"        "gtk-key-theme-name\0"
-  "Gtk/ToolbarStyle\0"        "gtk-toolbar-style\0"
   "Gtk/ToolbarIconSize\0"     "gtk-toolbar-icon-size\0"
   "Gtk/Modules\0"             "gtk-modules\0"
   "Gtk/CursorThemeName\0"     "gtk-cursor-theme-name\0"
index bffcb05aa008bcf4a2ffd224cd5dbd7c29c2d107..8f2adb3e3747fbc89e24feedf77198c8d6ac6a16 100644 (file)
@@ -33,7 +33,6 @@ static const struct {
   {"Gtk/ColorPalette",        "gtk-color-palette"},
   {"Gtk/FontName",            "gtk-font-name"},
   {"Gtk/KeyThemeName",        "gtk-key-theme-name"},
-  {"Gtk/ToolbarStyle",        "gtk-toolbar-style"},
   {"Gtk/ToolbarIconSize",     "gtk-toolbar-icon-size"},
   {"Gtk/Modules",             "gtk-modules"},
   {"Gtk/CursorThemeName",     "gtk-cursor-theme-name"},
index ceaec85ec451b4129008a990e59568756417c51f..472a480f9a3d30bfa9d9e49287b50e908afa1b34 100644 (file)
@@ -1173,13 +1173,15 @@ gtk_settings_class_init (GtkSettingsClass *class)
    * GtkSettings:gtk-toolbar-style:
    *
    * The size of icons in default toolbars.
+   *
+   * Deprecated: 3.10: This setting is ignored.
    */
   result = settings_install_property_parser (class,
                                              g_param_spec_enum ("gtk-toolbar-style",
                                                                    P_("Toolbar style"),
                                                                    P_("Whether default toolbars have text only, text and icons, icons only, etc."),
                                                                    GTK_TYPE_TOOLBAR_STYLE,
-                                                                   GTK_TOOLBAR_BOTH,
+                                                                   GTK_TOOLBAR_BOTH_HORIZ,
                                                                    GTK_PARAM_READWRITE),
                                              gtk_rc_property_parse_enum);
   g_assert (result == PROP_TOOLBAR_STYLE);
index e4dbfa45eb2aa79e5cf54a8f223a9e3161b264ef..9412cc01ad5f349722f91888f2f476ef0b020b60 100644 (file)
@@ -91,7 +91,7 @@ typedef struct _ToolbarContent ToolbarContent;
 #define SPACE_LINE_END      8.0
 
 #define DEFAULT_ICON_SIZE GTK_ICON_SIZE_LARGE_TOOLBAR
-#define DEFAULT_TOOLBAR_STYLE GTK_TOOLBAR_BOTH
+#define DEFAULT_TOOLBAR_STYLE GTK_TOOLBAR_BOTH_HORIZ
 #define DEFAULT_ANIMATION_STATE TRUE
 
 #define MAX_HOMOGENEOUS_N_CHARS 13 /* Items that are wider than this do not participate
@@ -2016,19 +2016,6 @@ toolbar_get_settings (GtkToolbar *toolbar)
   return toolbar->priv->settings;
 }
 
-static void
-style_change_notify (GtkToolbar *toolbar)
-{
-  GtkToolbarPrivate *priv = toolbar->priv;
-
-  if (!priv->style_set)
-    {
-      /* pretend it was set, then unset, thus reverting to new default */
-      priv->style_set = TRUE;
-      gtk_toolbar_unset_style (toolbar);
-    }
-}
-
 static void
 icon_size_change_notify (GtkToolbar *toolbar)
 {
@@ -2064,9 +2051,7 @@ settings_change_notify (GtkSettings      *settings,
                         const GParamSpec *pspec,
                         GtkToolbar       *toolbar)
 {
-  if (! strcmp (pspec->name, "gtk-toolbar-style"))
-    style_change_notify (toolbar);
-  else if (! strcmp (pspec->name, "gtk-toolbar-icon-size"))
+  if (! strcmp (pspec->name, "gtk-toolbar-icon-size"))
     icon_size_change_notify (toolbar);
   else if (! strcmp (pspec->name, "gtk-enable-animations"))
     animation_change_notify (toolbar);
@@ -2108,7 +2093,6 @@ gtk_toolbar_screen_changed (GtkWidget *widget,
   else
     priv->settings = NULL;
 
-  style_change_notify (toolbar);
   icon_size_change_notify (toolbar);
   animation_change_notify (toolbar);
 }
@@ -2910,14 +2894,7 @@ gtk_toolbar_unset_style (GtkToolbar *toolbar)
 
   if (priv->style_set)
     {
-      GtkSettings *settings = toolbar_get_settings (toolbar);
-      
-      if (settings)
-       g_object_get (settings,
-                     "gtk-toolbar-style", &style,
-                     NULL);
-      else
-       style = DEFAULT_TOOLBAR_STYLE;
+      style = DEFAULT_TOOLBAR_STYLE;
 
       if (style != priv->style)
        g_signal_emit (toolbar, toolbar_signals[STYLE_CHANGED], 0, style);
index 7d29f81b0a45938d9d124faa7fe61e2411e55f60..a90a3e493eb845933958cd72d50369033cea5105 100644 (file)
@@ -892,19 +892,6 @@ gtk_tool_palette_get_child_property (GtkContainer *container,
     }
 }
 
-static void
-style_change_notify (GtkToolPalette *palette)
-{
-  GtkToolPalettePrivate* priv = palette->priv;
-
-  if (!priv->style_set)
-    {
-      /* pretend it was set, then unset, thus reverting to new default */
-      priv->style_set = TRUE;
-      gtk_tool_palette_unset_style (palette);
-    }
-}
-
 static void
 icon_size_change_notify (GtkToolPalette *palette)
 {
@@ -923,9 +910,7 @@ gtk_tool_palette_settings_change_notify (GtkSettings      *settings,
                                          const GParamSpec *pspec,
                                          GtkToolPalette   *palette)
 {
-  if (strcmp (pspec->name, "gtk-toolbar-style") == 0)
-    style_change_notify (palette);
-  else if (strcmp (pspec->name, "gtk-toolbar-icon-size") == 0)
+  if (strcmp (pspec->name, "gtk-toolbar-icon-size") == 0)
     icon_size_change_notify (palette);
 }
 
@@ -1251,14 +1236,7 @@ gtk_tool_palette_unset_style (GtkToolPalette *palette)
 
   if (priv->style_set)
     {
-      GtkSettings *settings = toolpalette_get_settings (palette);
-
-      if (settings)
-        g_object_get (settings,
-                      "gtk-toolbar-style", &style,
-                      NULL);
-      else
-        style = DEFAULT_TOOLBAR_STYLE;
+      style = DEFAULT_TOOLBAR_STYLE;
 
       if (style != priv->style)
         gtk_tool_palette_change_style (palette, style);